package com.biostime.qdingding.modules.qd.entity;

import java.util.Date;
import java.util.List;

import com.biostime.qdingding.common.persistence.DataEntity;
import com.biostime.qdingding.common.utils.DateUtils;
import com.google.common.collect.Lists;

/**
 * 上课时间阶段Entity
 * @author king
 * @version 2015-11-05
 */
public class Coursesection extends DataEntity<Coursesection> {

	private static final long serialVersionUID = 1L;
	
	private Date starton;// 开始时间
	private Date endon;// 结束时间
	private Integer sort;// 排序
	private String state;// 状态
	private String name;// 显示名称
	private Center center; //早教中心
	
	private List<Course> courses = Lists.newArrayList();//上课时段包含课程
	
	public Coursesection(){
		super();
		sort = 99;
		state = "0";
	}
	
	public Coursesection(String id){
		super(id);
	}
	
	public Date getStarton() {
		return starton;
	}

	public void setStarton(Date starton) {
		this.starton = starton;
	}
	
	public Date getEndon() {
		return endon;
	}

	public void setEndon(Date endon) {
		this.endon = endon;
	}
	
	public Integer getSort() {
		return sort;
	}

	public void setSort(Integer sort) {
		this.sort = sort;
	}
	
	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public Center getCenter() {
		return center;
	}

	public void setCenter(Center center) {
		this.center = center;
	}

	public String getName() {
		this.name = String.format("%s-%s", DateUtils.formatDate(starton, "HH:mm"),DateUtils.formatDate(endon, "HH:mm"));
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<Course> getCourses() {
		return courses;
	}

	public void setCourses(List<Course> courses) {
		this.courses = courses;
	}
}